package cn.ljy.quicksnip.config.token;

import cn.ljy.authority.config.security.TokenConfig;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * token的配置信息类
 * 说明：属性设定为从Yml中进行配置
 * @author ljy
 * 20220122
 */
@Component
@Data
public class SchoolTokenConfig {
    @Autowired
    private TokenConfig tokenConfig;
    @Setter(AccessLevel.NONE)
    private String accessTokenKeyHeaderOfSchoolStudent;//学生的token账户信息

    // @PostConstruct用于在完成依赖项注入以执行
    @PostConstruct
    public void init(){
        //学生账户的token头部
        accessTokenKeyHeaderOfSchoolStudent="SchoolStudent_"+tokenConfig.getAccessTokenKeyHeader();
    }
}
